# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=py3-solidpython
pkgver=1.0.2
pkgrel=3
pkgdesc="Python library to generated OpenSCAD code"
url="https://github.com/SolidCode/SolidPython"
arch="noarch !aarch64 !armv7 !armhf" # openscad
license="LGPL-2.1-or-later"
depends="
	openscad
	py3-euclid3<0.2.0
	py3-prettytable
	py3-pypng
	py3-regex
	python3
	"
makedepends="
	py3-setuptools
	"
_pyname="solidpython"
_pypiprefix="${_pyname%${_pyname#?}}"
source="
	https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
	fix-versions.patch
	"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# Run the loop ourselves instead of relying on bash
	local i; for i in solid/test/test_*.py; do
		echo "$i"
		PYTHONPATH="$PWD/build/lib" python3 "$i"
	done
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="eeb7c68e54055fcfd5b53cf9c2745ea4dac602dbce158c8c7559dde21372c87cacbcac9c203cf0b577bd292a59304d48e8a4c7afcf9afdd9cc6c6cf0286e1d09  solidpython-1.0.2.tar.gz
41e71d68ba0381ea44ab206a95549558991e923a218d4a8d7730a8baa21922762d0d3555a61e5d81bfb39d1918627deb1f17fa2347d279a3cf9b14cbf8270ae4  fix-versions.patch"
